package com.ruoyi.orderdetails.domain;

import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 订单细节对象 orderdetails
 * 
 * @author sqlstudent
 * @date 2025-06-13
 */
public class Orderdetails extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单细节id */
    private Long orderDetailId;

    /** 订单id */
    @Excel(name = "订单id")
    private Long orderId;

    /** 商品id */
    @Excel(name = "商品id")
    private Long productId;

    /** 购买数量 */
    @Excel(name = "购买数量")
    private Long quantity;

    /** 价格 */
    @Excel(name = "价格")
    private BigDecimal price;

    public String cacheKey() {
        return "list::" +
                (this.getOrderId() != null ? this.getOrderId() : "null") + "_" +
                (this.getProductId() != null ? this.getProductId() : "null") + "_" +
                (this.getQuantity() != null ? this.getQuantity() : "null");
    }

    public void setOrderDetailId(Long orderDetailId) 
    {
        this.orderDetailId = orderDetailId;
    }

    public Long getOrderDetailId() 
    {
        return orderDetailId;
    }

    public void setOrderId(Long orderId) 
    {
        this.orderId = orderId;
    }

    public Long getOrderId() 
    {
        return orderId;
    }

    public void setProductId(Long productId) 
    {
        this.productId = productId;
    }

    public Long getProductId() 
    {
        return productId;
    }

    public void setQuantity(Long quantity) 
    {
        this.quantity = quantity;
    }

    public Long getQuantity() 
    {
        return quantity;
    }

    public void setPrice(BigDecimal price) 
    {
        this.price = price;
    }

    public BigDecimal getPrice() 
    {
        return price;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("orderDetailId", getOrderDetailId())
            .append("orderId", getOrderId())
            .append("productId", getProductId())
            .append("quantity", getQuantity())
            .append("price", getPrice())
            .toString();
    }
}
